home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / ab20 / ab20_archive / sounds / tools / startracker-1.2.lha / PAL.asm < prev    next >
Assembly Source File  |  1990-05-22  |  2KB  |  81 lines

  1.     OPT c+,l-,o+
  2.  
  3. *********************
  4. *                   *
  5. *    PAL 1.0        *
  6. *                   *
  7. *  by Nico François *
  8. *********************
  9.  
  10.     incdir "INCLUDE:"
  11.     include "exec/types.i"
  12.     include "exec/execbase.i"
  13.     include "exec/memory.i"
  14.     include "exec/resident.i"
  15.     include "exec/exec_lib.i"
  16.     include "graphics/gfxbase.i"
  17.     include "graphics/graphics_lib.i"
  18.     include "libraries/dos_lib.i"
  19.  
  20.     move.l ($4).w,a6
  21.     lea DosName(PC),a1
  22.     jsr _LVOOldOpenLibrary(a6)                ; open DOS
  23.     move.l d0,a6
  24.     jsr _LVOOutput(a6)
  25.     move.l d0,d7
  26.     move.l d0,d1
  27.     lea header.txt(PC),a0
  28.     move.l a0,d2
  29.     move.l #header.len,d3
  30.     jsr _LVOWrite(a6)
  31.  
  32.     move.w $DFF004,d0                            ; check for new 1Mb Agnus
  33.     and.w #$2000,d0
  34.     bne.s ok1MbAgnus
  35.     lea oldagnus.txt(PC),a0                    ; if not available print
  36.     move.l a0,d2
  37.     move.l #oldagnus.len,d3                    ; message
  38.     move.l d7,d1
  39.     jsr _LVOWrite(a6)
  40.     move.l a6,a1
  41.     move.l ($4).w,a6
  42.     jsr _LVOCloseLibrary(a6)
  43.     bra.s exit
  44.  
  45. ok1MbAgnus:
  46.     move.l a6,a1
  47.     move.l ($4).w,a6
  48.     jsr _LVOCloseLibrary(a6)
  49.     lea GfxName(PC),a1
  50.     jsr _LVOOldOpenLibrary(a6)                ; open graphics.library
  51.     move.l d0,a1
  52.     move.w gb_DisplayFlags(a1),d0
  53.     and.b #%11111110,d0                        ; clear NTSC flag
  54.     or.b  #%00000100,d0                        ; set PAL flag
  55.     move.w d0,gb_DisplayFlags(a1)
  56.     move.w #256,gb_NormalDisplayRows(a1)    ; WorkBench 256 pixels high
  57.     or.b #LIBF_CHANGED,LIB_FLAGS(a1)
  58.     move.l a1,a2
  59.     jsr _LVOSumLibrary(a6)                    ; recalculate checksum
  60.     move.l a2,a1
  61.     jsr _LVOCloseLibrary(a6)
  62.     move.b #50,VBlankFrequency(a6)        ; change VBLANK
  63.     or.b #LIBF_CHANGED,LIB_FLAGS(a6)
  64.     jsr _LVOSumLibrary(a6)                    ; recalculate checksum
  65.     move.w #32,$dff1dc                        ; this one does all the magic
  66. exit:
  67.     moveq #0,d0
  68.     rts
  69.  
  70. header.txt:
  71.     dc.b $9b,'1mPAL 1.0 ',$9b,'0m',$9b,'33mby Nico François',$9b,'0m',10
  72. header.len equ *-header.txt
  73. oldagnus.txt:
  74.     dc.b 'You haven''t got the ECS 1Mb Agnus, so run out and buy one !',10,0
  75. oldagnus.len equ *-oldagnus.txt
  76. DosName:    dc.b 'dos.library',0
  77. GfxName:    dc.b 'graphics.library',0
  78.     EVEN
  79.  
  80.     END
  81.